package com.meilai.project.constant;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * @author 张驰
 * @description 制作单-生成状态
 * @date 2022-08-16 17:35
 */
@Getter
public enum AdMakeGenStatusEnum {
    NONE(1, "未生成"),
    PART(2, "部分生成"),
    ALL(3, "已生成");

    @EnumValue
    private final Integer id;
    private final String name;

    AdMakeGenStatusEnum(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public static AdMakeGenStatusEnum getEnumById(Integer id) {
        for (AdMakeGenStatusEnum adMakeGenStatusEnum : AdMakeGenStatusEnum.values()) {
            if (adMakeGenStatusEnum.getId().equals(id)) {
                return adMakeGenStatusEnum;
            }
        }
        return null;
    }
}
